package com.common.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.common.R;
import com.common.event.LoginOutEvent;
import com.common.widget.ActionBar;

import de.greenrobot.event.EventBus;

/**
 * Created by mark on 15/3/6.
 */
public class BaseFragment extends Fragment {
    protected Activity activity;
    public ActionBar mActionBar;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        activity = getActivity();
        EventBus.getDefault().register(this);

    }

    public void initActionBar() {
        mActionBar = (ActionBar) getView().findViewById(R.id.action_bar);
    }

    public void onEvent(LoginOutEvent event){
        //不让编译报错，默认实现
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }
}
